package org.xtlgen;

import java.awt.Graphics2D;

/**
 * DisplayCanvas renders the Shape hierarchy on screen.
 */
public class DisplayCanvas implements Canvas {
  /**
   * Create a new DisplayCanvas and associate with the given graphics object.
   */
  public DisplayCanvas(Graphics2D graphics) {
    this.graphics = graphics;
  }

  /**
   * Draw the given Shape
   */
  public void draw(Shape shape) {
    graphics.draw(shape.getAWTShape());
  }

  Graphics2D graphics;
}